package com.alibaba.citrus.cr.sales.plan.model;

import java.util.Arrays;

/**
 * @author zls
 * @description: 提报维度类型
 * @date 2021-09-18 11:03
 */
public enum SalesPlanReportBizTypeEnum {
    /**
     * 业务员提报
     */
    PROMOTER_REPORT(1, "业务员提报"),

    /**
     * 销售部门提报(冗余)
     */
    DEPARTMENT_REPORT(2, "销售部门提报"),

    /**
     * 销售渠道提报
     */
    CHANNEL_REPORT(3, "销售渠道提报"),

    /**
     * 销售组织提报（冗余）
     */
    ORGANIZATION_REPORT(4, "销售组织提报"),

    /**
     * 业务单元提报
     */
    BUSINESS_DIMENSION_REPORT(5, "业务单元提报"),;

    private Integer code;
    private String desc;

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    SalesPlanReportBizTypeEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static SalesPlanReportBizTypeEnum of(Integer code) {
        return Arrays.stream(SalesPlanReportBizTypeEnum.values()).filter(source -> code == source.code).findFirst().orElse(null);
    }
}
